<template>
  <div>
    <div ref="rr" title="666"></div>
    <button @click="minusHouse($parent)">组件通信</button>
  </div>
</template>
<script setup lang="ts">
import { onMounted, ref } from 'vue'

const rr = ref()
onMounted(() => {
  console.log(rr.value)
})
const a = ref(0)
const b = ref(1)

const minusHouse = ($parent: any) => {
  $parent.house -= 1
}

defineExpose({ a, b: b.value })
</script>

<style lang="scss" scoped></style>
